<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVideoFilesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('video_files', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 32)->comment('标题');
            $table->string('image')->comment('封面');
            $table->string('video')->comment('视频');
            $table->unsignedInteger('category_id')->comment('所属分类');
            $table->unsignedInteger('teacher_id')->comment('所属老师');
            $table->text('introduction')->nullable()->comment('简介');
            $table->unsignedInteger('price')->comment('价格');
            $table->text('details')->nullable()->comment('详情');
            $table->boolean('state')->default(true)->comment('状态');
            $table->unsignedInteger('author_id')->comment('创建人');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('video_files');
    }
}
